export {}
// import { throttle } from "@/utils/common.util";
// import { ref } from "vue";

// export function useMouse(func: Function, selector?: string | HTMLElement, throttleTime?: number) {
//   let x = ref(0), y = ref(0)
//   let mouseMoveHandler: any
//   if(throttleTime) {
//     mouseMoveHandler =  throttle(function(e: MouseEvent | Event) {
//       x.value = (e as MouseEvent).x
//       y.value = (e as MouseEvent).y
//       func(x.value, y.value)
//     }, 100, true)
//   }else {
//     mouseMoveHandler = function(e: MouseEvent | Event) {
//       x.value = (e as MouseEvent).x
//       y.value = (e as MouseEvent).y
//       func(x.value, y.value)
//     }
//   }

//   let el: HTMLElement | Window = window || document
//   if(selector) {
//     if(typeof selector === 'string') {
//       el = document.querySelector(selector) as HTMLElement
//     }else {
//       el = selector
//     }
//   }
//   el.addEventListener('mousemove', mouseMoveHandler)
//   return { x, y, stop() {
//       el.removeEventListener('mousemove', mouseMoveHandler)
//     }
//   }
// }
